#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QDialog>

namespace Ui
{
	class Widget;
}

class FetchIpThread;
class Widget : public QDialog
{
	Q_OBJECT
public:
	explicit Widget ( QWidget *parent = 0 );

	void startAutoFetchIP ();
	void initMacList ();
	QString fetchIp () const;
    bool showIpTips (const QString &ip );
	bool isIpFetched ();

	~Widget ();

	private slots:
	void on_pushButton_editIP_clicked ();
	void on_pushButton_exit_clicked ();
	void on_pushButton_addMac_clicked ();
	void on_pushButton_deleteMac_clicked ();

	void saveMacList ();
	void loadMacList ();

	void addMyMacString ( const QString &str );
	void getMacAndRemarkFromMacString ( const QString &str , QString &mac , QString &remark );

	void addMacToList ( QString mac , const QString &remark = "" );

	QString combineMacAndRemark ( const QString &mac , const QString &remark );

	void on_pushButton_open_clicked ();
	void showStatus ( QString status );
	void disableOpen ();
	void enableOpen ();
	void autoFixProblems ();

private:
	Ui::Widget *ui;
};
#endif // WIDGET_H
